From: Jonas Dreßler Date: Sun, 1 Mar 2020 13:01:14 +0000 (+0100) Subject: slider: Include handle border radius when calculating center offset X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~761^2^2~2 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=3ddae9d8;p=gnome-shell.git slider: Include handle border radius when calculating center offset Since 38da479ee we correctly ceil the non-integer radius of the slider handle when calculating the offset for drawing the circle. Since the handle also has a border with a width of 1px by default, we should also factor that in when calculating the offset. Fixes https://gitlab.gnome.org/GNOME/gnome-shell/issues/1569 --- diff --git a/js/ui/slider.js b/js/ui/slider.js index 01b29e1fc..3a732e9cf 100644 --- a/js/ui/slider.js +++ b/js/ui/slider.js @@ -43,10 +43,10 @@ var Slider = GObject.registerClass({ let [hasHandleColor, handleBorderColor] = themeNode.lookup_color('-slider-handle-border-color', false); - let wholeHandleRadius = Math.ceil(handleRadius); - let handleX = wholeHandleRadius + - (width - 2 * wholeHandleRadius) * this._value / this._maxValue; - let handleY = height / 2; + const ceiledHandleRadius = Math.ceil(handleRadius + handleBorderWidth); + const handleX = ceiledHandleRadius + + (width - 2 * ceiledHandleRadius) * this._value / this._maxValue; + const handleY = height / 2; let color = themeNode.get_foreground_color(); Clutter.cairo_set_source_color(cr, color);